package com.benson.pattern.state;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class ProposalHandler {

	private ProposalState state;
	
	public void changeState(ProposalState state){
		this.state = state;
	}
	
	public void handle(Proposal proposal){
		
		List<String> fields = new ArrayList<String>();
		
		String SQL = state.buildSQL(proposal,fields);
		
		Map<String,Object> result = state.execSQL(SQL);
		
		Object obj = state.buildReport(result);

		state.saveReport(obj);
		
	}
}
